package com.hxd.otc.module.my.adapter;

import android.widget.CompoundButton;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.hxd.otc.R;
import com.hxd.otc.utils.LogUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * 包  名 :  com.hxd.otc.module.my.adapter
 * 类  名 :  VIPServiceAdapter
 * 作  者 :  zjl
 * 时  间 :  2018/12/18 15:17
 * 描  述 :  ${TODO}
 */
public class VIPServiceAdapter extends BaseQuickAdapter<String, BaseViewHolder> {

    private List<String> strings = new ArrayList<>();

    public VIPServiceAdapter() {
        super(R.layout.adapter_vip_service, null);
    }

    @Override
    protected void convert(BaseViewHolder helper, final String item) {
        helper.setText(R.id.cb_content, item);
        helper.setOnCheckedChangeListener(R.id.cb_content, new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                if (isChecked) {
                    strings.add(item);
                } else {
                    strings.remove(item);
                }
            }
        });

    }

    public List<String> getStrings() {
        return strings;
    }
}
